package com.atguigu.gmall.realtime.function;

import com.atguigu.gmall.realtime.bean.SourceCount;
import org.apache.flink.table.functions.TableFunction;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/11/5 14:42
 */
public class KwProduct extends TableFunction<SourceCount> {
    
    public void eval(Long click_ct, Long cart_ct, Long order_ct) {
        if (click_ct > 0) {
            collect(new SourceCount("click", click_ct));
        }
        
        if (cart_ct > 0) {
            collect(new SourceCount("cart", cart_ct));
        }
        
        if (order_ct > 0) {
            collect(new SourceCount("order", order_ct));
        }
    }
}
